package com.zrf.springCloudTest.controller;

import com.zrf.springCloudTest.api.ComputeClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 消费者
 * @author zrf
 *         Created by zrf on 2016/8/29.
 */
@RestController
public class ConsumeController {
    /**
     * 服务提供者的客户端
     */
    @Resource
    private ComputeClient computeClient;

    /**
     * add方法
     * @param a 参数a
     * @param b 参数b
     * @return a+b
     */
    @RequestMapping("add")
    public Integer add(Integer a, Integer b){
        return computeClient.add(a, b);
    }
}
